package com.groupbuying.sysconfig.service.impl;

import com.groupbuying.sysconfig.constants.CommonConstants;
import com.groupbuying.sysconfig.constants.SysconfigDeploySearchConstants;
import com.groupbuying.sysconfig.dao.SysconfigDeployDao;
import com.groupbuying.sysconfig.service.SysconfigDeployService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.groupbuying.sysconfig.domain.SysconfigDeployDO;



@Service
public class SysconfigDeployServiceImpl implements SysconfigDeployService {
	@Autowired
	private SysconfigDeployDao sysconfigDeployDao;
	
	@Override
	public SysconfigDeployDO get(BigInteger deployId){
		return sysconfigDeployDao.get(deployId);
	}
	
	@Override
	public List<SysconfigDeployDO> list(Map<String, Object> map){
		return sysconfigDeployDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return sysconfigDeployDao.count(map);
	}
	
	@Override
	public int save(SysconfigDeployDO sysconfigDeploy){
		return sysconfigDeployDao.save(sysconfigDeploy);
	}
	
	@Override
	public int update(SysconfigDeployDO sysconfigDeploy){
		return sysconfigDeployDao.update(sysconfigDeploy);
	}
	
	@Override
	public int remove(BigInteger deployId){
		return sysconfigDeployDao.remove(deployId);
	}
	
	@Override
	public int batchRemove(BigInteger[] deployIds){
		return sysconfigDeployDao.batchRemove(deployIds);
	}

	@Override
 	public String getPayChannel(){
		Map searchMap = new HashMap();
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_DEPLOYKEY,CommonConstants.ENUM_KEY_PAYCHANNEL);
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_ISDELETE,CommonConstants.COMMON_FLAG_UNDEL);
		SysconfigDeployDO sysconfigDeployDO = (SysconfigDeployDO)this.list(searchMap).get(0);
		return sysconfigDeployDO.getDeployValue();
	}

	@Override
	public String getYDOnlinePaySettle(){
		Map searchMap = new HashMap();
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_DEPLOYKEY,CommonConstants.ENUM_KEY_PAY_SCALE);
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_ISDELETE,CommonConstants.COMMON_FLAG_UNDEL);
		SysconfigDeployDO sysconfigDeployDO = (SysconfigDeployDO)this.list(searchMap).get(0);
		return sysconfigDeployDO.getDeployValue();
	}

	@Override
	public String getYDCurPaySettle(){
		Map searchMap = new HashMap();
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_DEPLOYKEY,CommonConstants.ENUM_KEY_CUR_SCALE);
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_ISDELETE,CommonConstants.COMMON_FLAG_UNDEL);
		SysconfigDeployDO sysconfigDeployDO = (SysconfigDeployDO)this.list(searchMap).get(0);
		return sysconfigDeployDO.getDeployValue();
	}

	@Override
	public String getGYCurPaySettle(){
		Map searchMap = new HashMap();
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_DEPLOYKEY,CommonConstants.ENUM_KEY_GYYHPAY_SCALE);
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_ISDELETE,CommonConstants.COMMON_FLAG_UNDEL);
		SysconfigDeployDO sysconfigDeployDO = (SysconfigDeployDO)this.list(searchMap).get(0);
		return sysconfigDeployDO.getDeployValue();
	}


	@Override
	public String getYDCashChannel(){
		Map searchMap = new HashMap();
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_DEPLOYKEY,CommonConstants.ENUM_KEY_CASH_CHANNEL);
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_ISDELETE,CommonConstants.COMMON_FLAG_UNDEL);
		SysconfigDeployDO sysconfigDeployDO = (SysconfigDeployDO)this.list(searchMap).get(0);
		return sysconfigDeployDO.getDeployValue();
	}

	@Override
	public String getYDFeeCash(){
		Map searchMap = new HashMap();
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_DEPLOYKEY,CommonConstants.ENUM_KEY_FEE_CASH);
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_ISDELETE,CommonConstants.COMMON_FLAG_UNDEL);
		SysconfigDeployDO sysconfigDeployDO = (SysconfigDeployDO)this.list(searchMap).get(0);
		return sysconfigDeployDO.getDeployValue();
	}

	@Override
	public String getYDFeeReplace(){
		Map searchMap = new HashMap();
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_DEPLOYKEY,CommonConstants.ENUM_KEY_FEE_REPLACE);
		searchMap.put(SysconfigDeploySearchConstants.SEARCH_ISDELETE,CommonConstants.COMMON_FLAG_UNDEL);
		SysconfigDeployDO sysconfigDeployDO = (SysconfigDeployDO)this.list(searchMap).get(0);
		return sysconfigDeployDO.getDeployValue();
	}
}
